package com.gxa.web_admin.global_exception;

import com.gxa.common.R;
import org.apache.shiro.authz.AuthorizationException;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

@ControllerAdvice
public class GlobalException {

    @ExceptionHandler(AuthorizationException.class)
    @ResponseBody
    public R noAuth(){
        R r = new R();
        r.setCode(500);
        r.setMsg("无权限访问");
        return r;
    }


}
